
import numpy as np, cv2


def decode(stringData_rgb, stringData_depth):
        data_rgb = np.frombuffer(stringData_rgb, np.uint8)#将获取到的字符流数据转换成1维数组
        decimg_rgb=cv2.imdecode(data_rgb,cv2.IMREAD_COLOR)#将数组解码成图像
        # data_depth = np.frombuffer(stringData_depth, np.uint8)#将获取到的字符流数据转换成1维数组
        # logger.info("data_depth: {}".format(data_depth[100:200]))
        # decimg_depth=cv2.imdecode(data_depth,cv2.IMREAD_UNCHANGED)#将数组解码成图像
        # decimg_depth = cv2.cvtColor(decimg_depth,cv2.COLOR_BGR2GRAY)
        decimg_depth = None
        return decimg_rgb, decimg_depth